{
  "properties" : { },
  "id" : "69b299e102a544f19b9b244215daaad7",
  "script" : null,
  "groupId" : "fe43a82bf35d4dc8830b340876318d17",
  "name" : "会话管理左侧列表",
  "createTime" : 1727071165809,
  "updateTime" : 1726279069014,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "listNew",
  "method" : "GET",
  "parameters" : [ {
    "name" : "current",
    "value" : "1",
    "description" : "",
    "required" : true,
    "dataType" : "Integer",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : ">1",
    "children" : [ ]
  }, {
    "name" : "size",
    "value" : "5",
    "description" : "",
    "required" : true,
    "dataType" : "Integer",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "expression",
    "error" : "",
    "expression" : "size>0",
    "children" : [ ]
  }, {
    "name" : "deviceName",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 400,\n    \"message\": \"参数[size]不满足表达式\",\n    \"data\": {}\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "500",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "success",
      "value" : "false",
      "description" : "",
      "required" : false,
      "dataType" : "Boolean",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "msg",
      "value" : "系统维护中，请稍后重试。",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import java.lang.Integer
import org.apache.commons.lang3.StringUtils;
    import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
    import response;
     // 根据  ip   别名  名字  ;  
     var sql1="""
      SELECT
            dc.ID,
            dc.device_type,
            dc.dept_id,
            dc.device_model_id,
            dc.device_model,
            dc.ip,
            dc.direction,
            dc.net_region,
             d.device_alias,
              d.device_name
        FROM
            ndmp_device d
                LEFT JOIN ndmp_net_device_command dc ON dc.ID = d.ID
        where  d.mtnc_Status=0

            <if test=" deviceName != '' and  deviceName != null">
               and ( d.ip LIKE  concat('%',CAST(#{deviceName} AS VARCHAR),'%')
                OR d.device_name LIKE   concat('%',CAST(#{deviceName} AS VARCHAR),'%')
                OR d.device_alias LIKE   concat('%',CAST(#{deviceName} AS VARCHAR),'%')
                OR F_PINYIN(d.device_name) LIKE  UPPER( concat('%',CAST(#{deviceName} AS VARCHAR),'%'))
                OR F_PINYIN(d.device_alias) LIKE  UPPER( concat('%',CAST(#{deviceName} AS VARCHAR),'%'))
                )
            </if>     
     """;
        IPage page = db.page(sql1,size,current-1);

        if(page.records==null){
            return null;
        }
        List rs = new ArrayList();
        for (record in page.records) {
          var protocol =  db.table('ndmp_net_device_protocol').where().eq('device_id',record.id).selectOne();
            // 组合对象
            // SessionCtrl.SessionCtrlBuilder builder = SessionCtrl.builder();
            // SessionCtrl row = builder.displayName(record.deviceAlias!=null?record.deviceAlias:record.deviceName)
            //        .name(record.deviceName==null?"":record.deviceName)
            //         .deviceId(record.id==null?"":record.id)
            //        .direction(record.direction==null?"":record.direction)
            //        .netRegion(record.netRegion==null?0:Integer.parseInt(record.netRegion) )
            //         .build();
            var row={
                displayName:record.deviceAlias!=null?record.deviceAlias:record.deviceName,
                name:record.deviceName==null?"":record.deviceName,
                deviceId:record.id==null?"":record.id,
                direction:record.direction==null?"":record.direction,
                netRegion:record.netRegion==null?0:Integer.parseInt(record.netRegion) 
            }
           // row.displayName  =  (record.deviceAlias!=null?record.deviceAlias:record.deviceName);
            // row.name= (record.deviceName);
            // row.deviceId=(record.id);
            // row.direction=(record.direction);
            // row.netRegion=(record.netRegion);
            row.host=(record.ip);
            if (protocol != null) {
                if (StringUtils.isNotBlank(protocol.devicePassword)) {
                    row.password=(protocol.devicePassword);
                }
                row.username=(protocol.deviceUsername);
                row.port=(Optional.ofNullable(protocol.devicePort).orElse(22));
            }
            rs.add(row);

        }
        // IPage  sessionCtrlIPage = new Page ()
        //         .setTotal(page.total)
        //        // .setRecords(rs)
        //      //   .setPages(page.pages)
        //         .setCurrent(page.current);
       return response.json({
    "status": 200,
    "message": "查找成功",
    "data": {
        "total": page.total,
        "current": page.current,
        "size": page.size,
        "records":rs
        }
        
});